<h1 class="page-title"><?php echo $this->translate('order history') ?></h1>
<div class="fieldset">
    <h2 class="legend"><?php echo $this->translate('purchased order') ?></h2>
	<?php if(count($this->order_purchase) > 0): ?>
    <table>
        <thead>
            <tr>
                <th style="width: 15%;">
                    <?php echo $this->translate('order id'); ?>
                </th>
                <th style="width: 15%;">
                    <?php echo $this->translate('quantity'); ?>
                </th>
                <th>
                    <?php echo $this->translate('total'); ?>
                </th>
                <th>
                    <?php echo $this->translate('date add'); ?>
                </th>
                <th>
                    <?php echo $this->translate('purchase date'); ?>
                </th>
            </tr>
        </thead>
        <tbody>
            <?php foreach($this->order_purchase as $row): ?>
            <tr>
                <td>
                    <?php echo $row->id; ?>
                </td>
                <td>
                    <?php echo count(unserialize($row->items)); ?>
                </td>
                <td>
                    <?php echo number_format($row->total, 0, null, "."); ?>đ
                </td>
                <td>
                    <?php echo date("d-m-Y", strtotime($row->date)); ?>
                </td>
                <td>
                    <?php echo date("d-m-Y", strtotime($row->purchase_date)); ?>
                </td>
            </tr>
            <?php endforeach; ?>
        </tbody>
    </table>
    <?php else: ?>
    <p><?php echo $this->translate('no order'); ?></p>
    <?php endif; ?>
	<div class="buttons-set">
		<p class="required">* Required Fields</p>
		<a href="account_login.html" title="Back" class="f-left">&laquo; Back</a>
		<a title="Submit" class="colors-btn"><span><span>Submit</span></span></a>
		<div class="clear"></div>
	</div>
</div>
<style>
table{
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

table, th, td{
    border: 1px solid #e9e9e9;
}

th{
    font-weight: bold;
}

td{
    text-align: center;
}
</style>